<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	$("#myName").focus(function() {
		var val=$(this).val();
		if(val==this.defaultValue){
			$(this).val("");
		}
	}).blur(function() {
		var val=$(this).val();
		if($.trim(val) == ""){
			this.value = this.defaultValue;
		}
			
	})

$("#login").click(function() {
	$.get("com.lei.servlet.UserServlet",{"name":$("#username").val(),"password":$("#password").val()},function(data){
		if(json.success == 0){
			alert("用户名或密码错误");
		}else{
			alert("登录成功");
		}
	})
});
$("#out").click(function() {
	window.location.href="index.html";
});
	
})
</script>
</head>
<body>

用户名：<input type="text" name="userName" id="myName" value="请输入用户名"><p>
密码：<input type="password" name="password" id="myword" value="请输入密码"></p>
<!--  <button type="button" id="login">登录</button>
<button type="button" id="out">退出</button>-->
<input type="submit" id="login" value="登录">
<input type="submit" id="out" value="退出">
</body>
</html>